{% from '@SyliusAdmin/shared/helper/breadcrumbs.html.twig' import breadcrumbs %}

{% if hookable_metadata.context.metadata is defined %}
    {% set metadata = hookable_metadata.context.metadata %}
    {% set resource_name = hookable_metadata.configuration.resource_name|default(metadata.applicationName~'.ui.'~metadata.pluralName) %}
{% else %}
    {% set resource_name = hookable_metadata.configuration.resource_name %}
{% endif %}

{% set configuration = hookable_metadata.context.configuration %}
{% set index_url = path(
    configuration.vars.index.route.name|default(configuration.getRouteName('index')),
    configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({}))
)
%}

{{ breadcrumbs([
    { name: 'sylius.ui.dashboard', url: path('sylius_admin_dashboard'), active: false },
    { name: resource_name, url: index_url, active: false },
    { name: 'sylius.ui.new'|trans, active: true}
]) }}
